xen: Fix event-channel destruction.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 3 Jul 2007 16:22:17 +0000 (17:22 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 3 Jul 2007 16:22:17 +0000 (17:22 +0100)
commitf8a7ef4fec62319885176999f9729721126c6b23
tree25a9b8510ef97211aa52d18483c2f7040d350f42
parent57a3afdaf3af8b0e64f9acefc63efdd1e3c5559d
xen: Fix event-channel destruction.

Lots of churn to fix a couple of bugs:

 1. If we tried to close an interdomain channel, and the remote domain
    is being destroyed, we immediately return success. But the remote
    domain will place our port in state 'unbound', not 'free'. Hence
    the port is effectively leaked.

 2. If two domains are being destroyed at the same time, and share an
    interdomain channel, the second to attempt the close may
    dereference an invalid domain pointer. Aiee!

Doing som ework to be able to destroy event-channel context much
earlier in domain death was the civilised thing to do.

Signed-off-by: Keir Fraser <keir@xensource.com>
xen/common/domain.c
xen/common/event_channel.c